package org.example.wx_springboot.service.impl;

import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.example.wx_springboot.controller.request.OrderdataRequest;
import org.example.wx_springboot.entity.Commodity;
import org.example.wx_springboot.entity.Orderdata;
import org.example.wx_springboot.mapper.GoodsListsMapper;
import org.example.wx_springboot.mapper.OrderdataMapper;
import org.example.wx_springboot.service.IOrderdataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class OrderdataService implements IOrderdataService {

    @Autowired
    OrderdataMapper orderdataMapper;


    @Override
    public List<Orderdata> list() {
        return orderdataMapper.list();
    }

    @Override
    public void save(Orderdata orderdata) {
        orderdataMapper.save(orderdata);
    }

    @Override
    public void deleteById(Integer id) {
        orderdataMapper.deleteById(id);
    }

    @Override
    public void update(Orderdata obj) {
        orderdataMapper.updateById(obj);
    }

    @Override
    public Object page(OrderdataRequest orderdataPageRequest) {
        List<Orderdata> orderdata = orderdataMapper.listOrderdata(orderdataPageRequest);
        return new PageInfo<>(orderdata);
    }
}
